const areaService = require("../services/areaService");
const { checkSqlField } = require("../utils");
const areaModel = require("../models/areaModel");
// 添加用户
exports.addArea = async (req, res) => {
  try {
    await checkSqlField(req, areaModel.checkAreaName, "areaName");
    await areaService.addArea(req, res);
  } catch (error) {
    res.tip(error);
  }
};
exports.editArea = async (req, res) => {
  try {
    await checkSqlField(req, areaModel.checkAreaName, "areaName");
    await areaService.editArea(req, res);
  } catch (error) {
    res.tip(error);
  }
};
exports.deleteArea = async (req, res) => {
  try {
    await areaService.checkId(req);
    await areaService.deleteArea(req, res);
  } catch (error) {
    res.tip(error);
  }
};
